package com.huawei;

import java.util.LinkedHashMap;
import java.util.Scanner;


public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String in = sc.nextLine();
            if (in.lastIndexOf('.') != -1) {
                String[] sa = in.split("\\.");
                long[] a = new long[4];
                for (int i = 0; i < 4; i++) a[i] = Long.parseLong(sa[i]);
                System.out.println(a[0] << 24 | a[1] << 16 | a[2] << 8 | a[3]);
            } else {
                long d = Long.parseLong(in);
                String out = String.format("%d.%d.%d.%d", (d >> 24) & 0xff, (d >> 16) & 0xff, (d >> 8) & 0xff, d & 0xff);
                System.out.println(out);
            }
        }
        sc.close();
    }
}
